Programming languages have different philosophies. They are often referred as being “strong” or “weak” and “static” or “dynamic”.
Statically-typed languages (C++, Rust)
Strongly but dynamically-typed languages (e.g. Python)
Weakly-typed languages (e.g. Javascript)
5+"2"="52"Like most programming languages, python has a bool datatype. In some ways, this is the simplest type available. A Boolean can only be True or False, and is returned when evaluating an expression. For example:
our_result = 10>9 print(our_result)
Returns True - we’re asking Python for the result of the comparison 10>9, and to store this result in a variable called our_result. The data type of a true-false comparison result like that is bool, so our variable will also be of this type.
Booleans will become highly relevant when we talk about conditionals and program flow.
Numeric types are for variables that will only contain numbers. Other programming languages often have many different numeric types, but Python (mercifully) only has two:
int can contain any2 whole (no fraction or decimals) number; negative, positive or zero. E.g.
a = -4b = 3c = 9087358292578float can contain any number with a decimal point, to arbitrary3 precision. E,g, - x = -2.2 - y = 3.0 - z = 2452.259259999999999
If you’re manually assigning a number to a variable, python will always choose an int or float depending on whether you’ve used a decimal point or not - so 2 and 2.0 are not equivalent in this context.
With data structures, we can address an element or elements by using square bracket notation - more on this below.
Strings (str)
An ordered sequence (string) of letters4. Enclosed by quotation marks. E.g.
our_string = "Hello world"Lists (list)
An ordered sequence of objects, where each object can be another data type (int, float, string, bool, etc). Enclosed by square brackets, and the items separated by commas. E.g.
our_list = [1, 2.3, "abc"]Dictionaries (dict)
Dictionaries are key-value pairs, where each entry is a pair of entries. Enclosed by curly braces, the keys and values separated by a colon and each pair separated by a comma. E.g.
our_dict = {"org_code":"0DF","name":"SCW CSU","year": 2013}Built-in
tuples, the latter being like a dict but non-changeable.Other packages
numpy package.pandas also offers additional data types such as timestamp (similar to SQL’s datetime).dataframes (from pandas) are an example of a higher-order class that makes use of datatypes within it; remember from previous sessions that a dataframe can contain strings, integers, timestamps etc.Don’t worry about memorising any of this! If you take one thing away from this session, make it the fact that data types exist, that being aware of them will help you understand problems with your code, and that resources and documentation are readily available online.
experimental ternary computers and quantum computing are firmly out of scope of this presentation
there is no clearly-defined maximum number for an integer in python; certainly not one you’re likely to ever encounter
again, limits exist but aren’t relevant here
or numbers, symbols, etc. - any valid UTF-8 symbols
SAT // Intro to Data Types // July 2025